<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <div>TODO write content</div>
      
    </body>
</html>
<script>
    var str = '{"birthday":"1990-07-27","department_fk":"1043","hospital_name":"施甸县中医医院","phone":"18565758857","cxhd_id":"","username":"admin","hospital_code":"{"hospital_code":"CX0712131CN2968"}","job_level_name":"其他","hospital_fk":"1031","ch_name":"超级管理员","gender":"男","uuid":"23EC030A6F2E42FAB0150FBA1B4C0999","department_name":"内科"}';
    
     function getIdFromUrl(url) {
    var matched = url.match(/\?window_id=([^&]*)/);
    console.log(matched);
    return matched && matched[1];
  }
  getIdFromUrl("https:/sdfsdf/?window_id=1231231231");
    var web;
  var login = function () {
                    if (!web) {
                       // web = new WebSocket("ws://60.161.186.217:33888/websocket");
                          web = new WebSocket("ws://127.0.0.1:30080/?window_id="+new Date().getTime());
                    }
                    web.onopen = function () {
                        console.log("open");
                        var msg = {type:"geAllWin",data:"tttestsdsdf"};
                        web.send(JSON.stringify(msg));
                    }


                    web.onmessage = function (e) {

                        console.log(e.data);
                       

                    };

                    web.onclose = function (e) {
                       // web = null;
                        console.log("close");
                    };
                    web.onerror = function (e) {
                           console.log("errorx");
                    };
                }
               login();
</script>
